﻿@using WebMarkupMin.Core.Minifiers;
@using WebMarkupMin.Example.Mvc.Resources;

@model MinificationStatistics

@helper FormatSize (long size)
{
	string formattedSize;
	if (size >= 1024)
	{
		formattedSize = string.Format("{0:0.00}KB", Math.Round((decimal) size/1024, 2));
	}
	else
	{
		formattedSize = string.Format("{0} bytes", size);
	}

	@Html.Raw(formattedSize)
}

<dl class="minification-statistics dl-horizontal">
	<dt>@MinificationStrings.DisplayName_OriginalSize:</dt>
	<dd>@FormatSize(Model.OriginalSize) (@FormatSize(Model.OriginalGzipSize) gzipped)</dd>

	<dt>@MinificationStrings.DisplayName_MinifiedSize:</dt>
	<dd>@FormatSize(Model.MinifiedSize) (@FormatSize(Model.MinifiedGzipSize) gzipped)</dd>

	<dt>@MinificationStrings.DisplayName_Saved:</dt>
	<dd>@Model.SavedInPercent% (@Model.SavedGzipInPercent% gzipped)</dd>

	<dt>@MinificationStrings.DisplayName_MinificationDuration:</dt>
	<dd>@Model.MinificationDuration milliseconds</dd>
</dl>